package com.tvsinfo.jdk.demo.case2_function_interface;

import java.util.function.Consumer;

public class ConsumerTest {


    public static void main(String[] args) {
        ConsumerTest consumerTest = new ConsumerTest();
        //
        Application producer = new Application();
        consumerTest.consumer(producer::setApplication, consumerTest.genApplicationNo());

        //
        Installment installment = new Installment();
        consumerTest.consumer(installment::setInstallmentNo, consumerTest.genInstallmentNo());
    }

    public <T> void consumer(Consumer<T> consumer, T no) {
        Object quementParm = null;
        if (quementParm == null) {
            //...
        } else {
            consumer.accept(no);
        }
    }


    static class Application {
        void setApplication(String no) {

        }
    }

    static class Installment {
        void setInstallmentNo(String no) {

        }
    }


    static String genApplicationNo() {
        return "romdomIdxxx";
    }

    static String genInstallmentNo() {
        return "romdomIdxxx";
    }
}
